<template>
	<el-dialog :close-on-click-modal="false" :title="'查看'" :visible.sync="show" v-if="show" width="45%" v-loading="loading">
		
		<el-form ref="form" :model="request.data" :inline="true" label-width="80px">
			
					
						<el-col :span="12">
							<el-form-item label="企业名称:" prop="ename"><el-input v-model="request.data.ename" autocomplete="off" :disabled="true"></el-input></el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="企业地址:" prop="address"><el-input :disabled="true" v-model="request.data.address" autocomplete="off"></el-input></el-form-item>
						</el-col>
					
						<el-col :span="12">
							<el-form-item label="企业码:" prop="code"><el-input :disabled="true" v-model="request.data.code" autocomplete="off"></el-input></el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="联系电话:" prop="phone"><el-input :disabled="true" v-model="request.data.phone" autocomplete="off"></el-input></el-form-item>
						</el-col>
					
					<el-row>
						<el-col :span="12">
							<el-form-item label="企业类型:">
								<el-select v-model="request.data.type" placeholder="请选择" :disabled="true">
									<el-option label="已签约" :value="1"></el-option>
									<el-option label="未签约" :value="2"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="request.data.type != 2 ">
							<el-form-item label="签约日期:" prop="signtm"><el-input :disabled="true" v-model="request.data.signtm" autocomplete="off"></el-input></el-form-item>
						</el-col>
					</el-row>
					<el-col :span="12">
						<el-form-item label="餐标:" prop="std"><el-input :disabled="true" v-model="request.data.std" autocomplete="off"></el-input></el-form-item>
					</el-col>
					<el-col :span="12" v-if="request.data.type == 2">
						<el-form-item label="配送费" prop="sendcost"><el-input :disabled="true" v-model="request.data.sendcost" autocomplete="off"></el-input></el-form-item>
					</el-col>
					<el-row>
						<el-col :span="12">
							<el-form-item label="送餐开始:" prop="begintime"><el-input :disabled="true" v-model="request.data.begintime" autocomplete="off"></el-input></el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="送餐终止:" prop="endtime"><el-input :disabled="true" v-model="request.data.endtime" autocomplete="off"></el-input></el-form-item>
						</el-col>
					</el-row>
					
					<el-col :span="12" v-if="request.data.type == 1">
							<el-form-item label="用餐人数:" prop="empcnt"><el-input :disabled="true" v-model="request.data.empcnt" autocomplete="off"></el-input></el-form-item>
					</el-col>
					
					<el-row v-if="request.data.endlch != null">
						<el-col :span="12">
							<el-form-item label="午餐截单:" prop="endlch"><el-input :disabled="true" v-model="request.data.endlch" autocomplete="off"></el-input></el-form-item>
						</el-col>
					</el-row>
					
					<el-row v-if="request.data.enddnr != null">
						<el-col :span="12">
							<el-form-item label="晚餐截单:" prop="enddnr"><el-input :disabled="true" v-model="request.data.enddnr" autocomplete="off"></el-input></el-form-item>
						</el-col>
					</el-row>
					
			<el-row>
				<el-col :span="24">
					<el-form-item label="企业logo:" prop="logo">
					  <img id="headImg" :src="request.data.logo" v-if="request.data.logo" style="width: 200px;150px"/>
					</el-form-item>
				</el-col>
			</el-row>
					
			<el-row>
				<el-col :span="24">
					<el-form-item label="形象图片:" prop="pic">
					  <img id="headImg" :src="request.data.pic" v-if="request.data.pic" style="width: 200px;150px"/>
					</el-form-item>
				</el-col>
			</el-row>	 
						
						
		
					
		
		
		</el-form>
		
		
	</el-dialog>
</template>

<script>
import utils from 'util/utils.js';
import validate from 'util/validate.js';
import api from 'api/crm/enterprise/enterprise.js';
export default {
	name: 'view',
	data() {
		return {
			loading: false,
			show: this.isDisplay,
			request: utils.newRequest(), 
			
			
		};
	},
	methods: {
		
		init() {
			this.request = utils.newRequest();
				this.request.param.id = this.parameter.id;
				api.toUpdate(this.request, response => {
					this.request.data = response.data;
				});
		}
	},
	props: {
		isDisplay: {
			type: Boolean,
			default() {
				return false;
			}
		},
		parameter: {
			type: Array | Object,
			default() {
				return {};
			}
		}
	},
	watch: {
		isDisplay(val) {
			this.show = val;
			if (val) {
				this.init();
			}
		},
		show(val) {
			this.$emit('update:isDisplay', val);
		},
		parameter(val) {
			this.parameter = val;
		}
	}
};
</script>

<style lang="scss">
@import '~common/custom/css/common.scss';

.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>
